﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ComputerStoreManager.ViewModel;

namespace ComputerStoreManager.View
{
    /// <summary>
    /// Interaction logic for ProductControl.xaml
    /// </summary>
    public delegate void OnProductControlAddProductEventHandler();
    public delegate void OnProductControlViewProductEventHandler();
    public partial class ProductControl : UserControl
    {
        public event OnProductControlAddProductEventHandler OnAddProductClicked;
        public event OnProductControlViewProductEventHandler OnViewProductClicked;
        public ProductControl()
        {
            InitializeComponent();
            this.DataContext = new ProductControlViewModel();
        }

        private void btnAddProduct_Click(object sender, RoutedEventArgs e)
        {
            if (OnAddProductClicked != null)
            {
                OnAddProductClicked();
            }
        }

        private void btnViewProduct_Click(object sender, RoutedEventArgs e)
        {
            if (OnViewProductClicked != null)
            {
                OnViewProductClicked();
            }
        }
    }
}
